package cn.yuanqiao.archive.detection.domain;

import cn.yuanqiao.common.exception.ServiceException;
import cn.yuanqiao.common.utils.StringUtils;
import cn.yuanqiao.common.utils.SecurityUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import cn.yuanqiao.common.annotation.Excel;
import cn.yuanqiao.common.core.domain.BaseEntity;

import java.util.List;

/**
 * 四性配置内容对象 YQ_FN_DETECTION_OBJECT
 *
 * @author xy
 * @date 2023-08-08
 */
public class DetectionObject extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    public static final String BIGTABLENAME = "_YQ_FN_DETECTION_OBJECT";

    public DetectionObject() {
        String tenantCode = SecurityUtils.getTenantCode();
        if(StringUtils.isEmpty(tenantCode)){
          //  throw new ServiceException("tenantCode is null");
        }else {
            this.tableName = tenantCode.toUpperCase()+BIGTABLENAME;
        }
    }


    /** id */
    private Long id;

    /** 方案Id */
    @Excel(name = "方案Id")
    private Long pId;

    /** 门类Id */
    @Excel(name = "门类Id")
    private Long categoryId;

    /** 四性检测Id */
    @Excel(name = "四性检测Id")
    private Long dId;

    /** 是否检测 */
    @Excel(name = "是否检测")
    private String isDetection;

    /** 是否默认通过 */
    @Excel(name = "是否默认通过")
    private String isPass;

    /** 创建人Id */
    @Excel(name = "创建人Id")
    private Long createId;

    private List<DetectionItem> detectionItemList;

    private String tableName;

    List<DetailLogs> detailLogsList;

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }
    public void setpId(Long pId)
    {
        this.pId = pId;
    }

    public Long getpId()
    {
        return pId;
    }
    public void setCategoryId(Long categoryId)
    {
        this.categoryId = categoryId;
    }

    public Long getCategoryId()
    {
        return categoryId;
    }
    public void setdId(Long dId)
    {
        this.dId = dId;
    }

    public Long getdId()
    {
        return dId;
    }
    public void setIsDetection(String isDetection)
    {
        this.isDetection = isDetection;
    }

    public String getIsDetection()
    {
        return isDetection;
    }
    public void setIsPass(String isPass)
    {
        this.isPass = isPass;
    }

    public String getIsPass()
    {
        return isPass;
    }
    public void setCreateId(Long createId)
    {
        this.createId = createId;
    }

    public Long getCreateId()
    {
        return createId;
    }

    public List<DetectionItem> getDetectionItemList() {
        return detectionItemList;
    }

    public void setDetectionItemList(List<DetectionItem> detectionItemList) {
        this.detectionItemList = detectionItemList;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public List<DetailLogs> getDetailLogsList() {
        return detailLogsList;
    }

    public void setDetailLogsList(List<DetailLogs> detailLogsList) {
        this.detailLogsList = detailLogsList;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("pId", getpId())
                .append("categoryId", getCategoryId())
                .append("dId", getdId())
                .append("isDetection", getIsDetection())
                .append("isPass", getIsPass())
                .append("createId", getCreateId())
                .append("createTime", getCreateTime())
                .toString();
    }
}
